#ifndef CHECKBOXITEMDELEGATE_H
#define CHECKBOXITEMDELEGATE_H

#ifdef COMMONCTRL_LIB
# define COMMONCTRL_EXPORT Q_DECL_EXPORT
#else
# define COMMONCTRL_EXPORT Q_DECL_IMPORT
#endif

#include <QStyledItemDelegate>


class COMMONCTRL_EXPORT CheckBoxItemdelegate : public QStyledItemDelegate
{
	Q_OBJECT

public:
	CheckBoxItemdelegate(QObject *parent);
	~CheckBoxItemdelegate();
	void	setEnable(bool bEnable);
	void	setColumnIndex(int nIndex);
protected:
	void	paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
	bool	editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index);
	QSize   sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;

private:
	bool	m_bEnable;
	int		m_nColumnIndex;
};

#endif // CHECKBOXITEMDELEGATE_H
